<ul>
    <?php foreach($this->getRecentPosts() as $post): ?>
    <li>
        <span class="small"><?php echo CHtml::encode(Yii::t('site','{date} ({username})',array('{username}'=>$post->author->first1Last,'{date}'=>Yii::app()->dateFormatter->formatDateTime($post->create_time,'medium','short')))); ?></span>
        <br/>
        <?php echo CHtml::link(CHtml::encode($post->title), $post->url); ?>
        <?php echo Yii::app()->user->checkAccess('admin') ? '&nbsp;'.CHtml::link(ICON_EDIT,array('/post/update','id'=>$post->id)) : ''; ?>
    </li>
    <?php endforeach; ?>
    <li style="margin-top:6px">
        <?php echo CHtml::link(Yii::t('site','View all news'),array('/post')); ?>
        <?php if(Yii::app()->user->checkAccess('admin')) : ?>
        <?php echo CHtml::link(ICON_NEW,array('/post/create'),array('title'=>Yii::t('site','Create a new News post'))); ?>
        <?php echo CHtml::link(ICON_VIEW,array('/post/admin'),array('title'=>Yii::t('site','Manage Posts'))); ?>
        <?php endif; ?>
    </li>
</ul>
